package deleteStrategy

import (
	"github.com/zhuxiujia/GoMybatis"
	"log"
)

// DeleteFlagPriority 逻辑删除字段优先
type DeleteFlagPriority struct {
}

func (deleteFlagPriority DeleteFlagPriority) Delete(session GoMybatis.Session) (int64, error) {
	defer func() {
		session.Commit()
	}()
	result, err := session.ExecPrepare("delete from monitor where delete_flag =1")
	if err != nil {
		log.Println(err)
		session.Rollback()
	}
	return result.RowsAffected, err
}
